#include <iostream>
using namespace std;

class AbstractCaculator
{
public:
	virtual int getResult() = 0;
	
protected:
	int a, b;
};

class PlusCaculator :public AbstractCaculator
{
public:
	PlusCaculator(int a, int b) {
		this->a = a;
		this->b = b;
	}
	virtual int getResult() {
		return this->a + this->b;
	}

};

class MinuteCaculator :public AbstractCaculator
{
public:
	MinuteCaculator(int a, int b) {
		this->a = a;
		this->b = b;
	}
	virtual int getResult() {
		return this->a - this->b;
	}

};

class MultiplyCaculator :public AbstractCaculator
{
public:
	MultiplyCaculator(int a, int b) {
		this->a = a;
		this->b = b;
	}
	virtual int getResult() {
		return this->a * this->b;
	}

};

void T01() {
	AbstractCaculator* caculator = new PlusCaculator(10, 20);
	cout << caculator->getResult() << endl;

	delete caculator;
}

int main(void) {

	T01();

	system("pause");
	return EXIT_SUCCESS;
}